package demo.day02

//20 Kotlin it关键字
fun main() {
    val methodAction: (Int, Int, Int) -> String = { n1, n2, n3 ->
        val number = 1213
        "action1 $n1+$n2+$n3"
    }
    println(methodAction(3, 4, 5))

    // 只有一个参数可以直接使用it
    val methodAction2: (String) -> String = { "$it 123456" }
    println(methodAction2("654321"))

    val methodAction3: (Double) -> String = {
        "传入数据为:->$it"
    }
    println(methodAction3(3.14))
}